/*
 * @Date: 2025-06-13 10:50:10
 * @Auth: 463997479@qq.com
 * @LastEditors: 463997479@qq.com
 * @LastEditTime: 2025-06-20 10:37:47
 * @FilePath: \corpus\src\pages\corpusFile\SplitCorpus\index.tsx
 */
import { Form, Input, Modal } from 'antd';
import type React from 'react';
import { useEffect } from 'react';
import hooks from '../hooks';
const EditSystem: React.FC = () => {
  const { TextArea } = Input;
  const { contentVisible, setContentVisible, formCorpus, content } = hooks.useContainer();
  const title = '拆分语料库';

  const handleSubmit = () => {
    setContentVisible(false);
    // formCorpus.validateFields().then((vals) => {
    //   const method = '';
    //   method.run({
    //     ...vals,
    //   });
    //   formCorpus.resetFields();
    // });
  };

  useEffect(() => {
    formCorpus.setFieldValue('content', JSON.stringify(content));
  }, [content]);
  return (
    <Modal
      width={600}
      title={title}
      open={contentVisible}
      onCancel={() => {
        setContentVisible(false);
        formCorpus.resetFields();
      }}
      onOk={handleSubmit}
    >
      <Form labelCol={{ span: 4 }} form={formCorpus}>
        <Form.Item name="id" hidden />
        {/* <Form.Item label={'关键词'} name="labelValue" rules={[{ required: true }]}>
          <Input placeholder="请输入关键词" />
        </Form.Item> */}
        <Form.Item label={''} name="content" rules={[{ required: true }]}>
          <TextArea autoSize={{ minRows: 4, maxRows: 26 }} placeholder="拆分之后文件内容" />
        </Form.Item>
      </Form>
    </Modal>
  );
};

export default EditSystem;
